﻿
using System;
using System.Collections.Generic;
using System.Text;

namespace hoemwork
{
    //object 栈
    public class MimicStack
    {
        private int top = 0;
        private object[] stack;
        public MimicStack(int capacity)
        {
            stack = new object[capacity];
        }
        public bool Pop()
        {
            if (top <= 0)
            {
                Console.WriteLine("栈为空");
                return false;
            }
            object value = stack[top - 1];
            Console.WriteLine();
            top--;
            return true;
        }
        public bool push(params object[] value)
        {
            if (top >= stack.Length)
            {
                Console.WriteLine("栈已满");
                return false;
            }
            for (int i = 0; i < value.Length - 1; i++)
            {
                stack[top] = value[i];
                top++;
            }

            return true;
        }


    }





}

